//
//  MSNoticeMessegeCell.m
//  觅尚
//
//  Created by No.8 on 2019/4/2.
//  Copyright © 2019 No.8. All rights reserved.
//

#import "MSNoticeMessegeCell.h"

@implementation MSNoticeMessegeCell

+ (instancetype)cellWithTableView:(UITableView *)tableView{
    MSNoticeMessegeCell * cell = [tableView dequeueReusableCellWithIdentifier:[MSNoticeMessegeCell ID]];
    cell = [[MSNoticeMessegeCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:[MSNoticeMessegeCell ID]];
    cell.backgroundColor = backgroundcolor;
    return cell;
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self setMember];
        
    }
    return self;
}
- (void)setMember{
   
    /** 背景*/
    self.BackView = [[UIView alloc] initWithFrame:CGRectMake(30 * px, 25 * px, ScreenWidth - 60 * px, 400 * px)];
    self.BackView.backgroundColor = BackViewColor;
    self.BackView.layer.cornerRadius = 5 * px;
    [self addSubview:self.BackView];
    
    
    /** 红点*/
    self.NoticeRedSpotlabel = [[UIView alloc] initWithFrame:CGRectMake(30 * px, 50 * px, 40 * px, 40 * px)];
    self.NoticeRedSpotlabel.backgroundColor = FontColor;
    self.NoticeRedSpotlabel.layer.cornerRadius = 20 * px;
    [self.BackView addSubview:self.NoticeRedSpotlabel];
    
    /** 内容*/
    self.Contentlabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.NoticeRedSpotlabel.frame) + 20 * px, self.NoticeRedSpotlabel.y - 10 * px, ScreenWidth - self.NoticeRedSpotlabel.x - self.NoticeRedSpotlabel.width - 40 * px, 60 * px)];
    self.Contentlabel.textColor = [UIColor whiteColor];
    self.Contentlabel.text = @"公司决定2019年3月12日-2019年2月15日放假。";
    self.Contentlabel.textAlignment = NSTextAlignmentLeft;
    self.Contentlabel.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
    [self.BackView addSubview:self.Contentlabel];
    
    
    /** 时间*/
    self.DateLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.BackView.width - 450 * px, CGRectGetMaxY(self.Contentlabel.frame) + 60 * px, 400 * px, 60 * px)];
    self.DateLabel.textColor = [UIColor grayColor];
    self.DateLabel.text = @"2019-03-20";
    self.DateLabel.textAlignment = NSTextAlignmentRight;
    self.DateLabel.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
    [self.BackView addSubview:self.DateLabel];
    
    
    
    /** 背景*/
    self.LinView = [[UIView alloc] initWithFrame:CGRectMake(self.NoticeRedSpotlabel.x, CGRectGetMaxY(self.DateLabel.frame) + 20 * px, self.BackView.width - self.NoticeRedSpotlabel.x * 2, 1)];
    self.LinView.backgroundColor = [UIColor grayColor];
    [self.BackView addSubview:self.LinView];
    
    
    
    /** 已送达人数*/
    self.HasBeenSentLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.LinView.x, CGRectGetMaxY(self.LinView.frame) + 20 * px, 400 * px, 60 * px)];
    self.HasBeenSentLabel.textColor = [UIColor grayColor];
    self.HasBeenSentLabel.text = @"已发送人数(35)";
    self.HasBeenSentLabel.textAlignment = NSTextAlignmentLeft;
    self.HasBeenSentLabel.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
    [self.BackView addSubview:self.HasBeenSentLabel];
    
    
    /** 回复人数*/
    self.ReplyLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.DateLabel.x, self.HasBeenSentLabel.y, self.HasBeenSentLabel.width, self.HasBeenSentLabel.height)];
    self.ReplyLabel.textColor = [UIColor grayColor];
    self.ReplyLabel.text = @"回复人数(35)";
    self.ReplyLabel.textAlignment = NSTextAlignmentRight;
    self.ReplyLabel.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
    [self.BackView addSubview:self.ReplyLabel];
    
}
+(NSString *)ID{
    return @"cell";
}

@end
